#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;

/*void reverse(char* str) {
    int size = 0;
    while(*str) {
        ++size;
        ++str;
    }
    str -= size;
    for(int i = 0; i < size / 2; ++i) {
        str[i] ^= str[size - i - 1];
        str[size - i - 1] ^= str[i];
        str[i] ^= str[size - i - 1];
    }
}*/

void reverse(char* str) {
    int size = strlen(str);
    reverse(str, str + size);
}

int main() {
    char str[] = "lorem ipsum";
    cout << str << endl;
    reverse(str);
    cout << str << endl;
    return 0;
}
